Month.prototype = {

    getActivitySummary: function() {
        var activitySummary = new ActivitySummary();
        this._daysInMonth.foreach(function(dayModel) {
            var activities = dayModel.getActivities();
            activities.foreach(function(activity) {
                activitySummary[activity] += 1.0 / activities.length;
            });
        });
        return activitySummary;
    },

    getLocationSummary: function() {
        var locationSummary = new LocationSummary();
        this._daysInMonth.foreach(function(dayModel) {
            var locations = dayModel.getLocations()
                                    .where(function(location) { return location != null; })
                                    .select(function(location) { return location.fullname; });
            locationSummary.appendLocationsInOneDay(locations);
        });
        return locationSummary;
    },

    getTravelSteps: function() {
        return this._travelSteps ? this._travelSteps : [];
    },

    _createDayIndex: function() {
        this._dateIndex = {};
        for (var i = 0; i < this._days.length; i++) {
            var currentDay = this._days[i];
            this._dateIndex[currentDay.getDate().toString(CalendarConstants.JSONDateFormat)] = currentDay;
        }
    },

    _createMonth: function() {
        var last = this._createDaysInLastMonth();
        var current = this._daysInMonth;
        var next = this._createDaysInNextMonth();
        this._days =
        [].concat(last)
                .concat(current)
                .concat(next);
    },

    _createDayForRange: function(startDate, endDate) {
        var me = this;
        var days = [];
        var currentDay = startDate.clone();
        while (currentDay <= endDate) {
            days.push(new Day({ date: currentDay.clone() }, me));
            currentDay = currentDay.addDays(1);
        }
        return days;
    }
};